<template>
	<view>
		<cu-custom :key="'header'+headerKey" bgColor="bg-gradual-blue" title="码上证明"
		:isBack="true" backText="返回"></cu-custom>
		<view class="main">
			<view>
				<view v-for="(prove,i) in proveList" style="background-color: #ffffff;">
					<view class="proveList" @click="printProve(prove)">{{prove.proveName}}</view>
					<view class="splitLine" v-if="proveList.length>i+1"></view>
				</view>
			</view>
		</view>
		<u-modal v-model="modelShow"  :content="modelContent" :confirm-color="userType=='20'?'#0081ff':'#f37b1d'"></u-modal>
	</view>
</template>

<script>
	import api from '@/api/society/home/home.js';
	export default {
		onShow() {
			this.headerKey += 1;
		},
		data(){
			return {
				headerKey:0,
				proveList:[],
				modelShow:false,
				modelContent:''
			}
		},
		created(){
			this.getProveList();
		},
		methods: {
			printProve(a){
				this.$Router.push({name: "proveInfo", params: {proveData:a}})
			},
			getProveList(){
				const info = {};
				this.$http.post(api.getProveList,info).then(res => {
					if(res.code==0){
						let array = res.result;
						console.log(array);
						if(array.length>0){
							let proveList = array;
							// this.proveList = array;
							// this.proveList.push({proname_1:'社保证明'});
							proveList.push({proveName:'社保证明'});
							this.proveList = proveList;
						}else{
							this.modelContent='未查询到您的职称证书信息';
							this.modelShow = true;
						}
					}
				}).catch(error => {
					
				})
			}
		}
	}
</script>

<style>
	page{
		background-color: #d0d0d0;
	}
	.main{
		width: 750rpx;
		height:1214rpx;
		display: flex;
		justify-content: center;
		position:absolute;
	}
	.proveList{
		width: 750rpx;
		height:80rpx;
		font-size: 36rpx;
		text-indent:1rem;
		line-height: 80rpx;
	}
	.splitLine{
		background: #d0d0d0;
		width: 700rpx;
		height: 3rpx;
		margin-left: 25rpx;
		margin-right: 25rpx;
	}
</style>
